Dynomotion

Group: DynoMotion Message: 11187 From: Hardy Family Date: 3/9/2015
Subject: C compiler can link with memcpy
Hi Tom,

I accidentally put in a call to memcpy() in my Kflop code, and it actually compiles, links and runs.  memset() seems to be there too.

These are useful functions.  Can I depend on these being there in the future?  Any other standard library goodies hidden in there?

On a related note, kmotiondef.h has the line
extern MAIN_STATUS MainStatus;

however reference to MainStatus fails to link.  The reason I was looking at this is that I wish to transfer some internally generated 128 I/O bits in the main status packet.  I was thinking of just jamming them in there, but that plan does not seem workable.  Is there a better (officially sanctioned) way of using the kanalog etc. fields which are otherwise unused in my app?

Regards,
SJH


Group: DynoMotion Message: 11192 From: Tom Kerekes Date: 3/10/2015
Subject: Re: C compiler can link with memcpy
Hi SJH,

We don't document those functions but they are likely to be there in the future (not sure exactly why they are linked in).

Regarding MainStatus.  That should not be defined as MainStatus has been changed to be a temporary structure used to be filled in and sent to the PC whenever the host PC requests MainStatus.  It wouldn't make sense to access it from a User Program.

I'm not sure what you are trying to accomplish.  Are you writing your own PC Application? 

There are 8 - 32-bit Persist Variables copied to the MainStatus Structure and included in the uploaded status.  You might consider using 4 of those for your 128 bits of data.  See:

#define PC_COMM_PERSIST 100  // First Persist Variable that is uploaded in status
#define N_PC_COMM_PERSIST 8  // Number of Persist Variables that are uploaded in status

    int    PC_comm[N_PC_COMM_PERSIST];// 8 persist Variables constantly uploaded to send misc commands/data to PC
Or your App could upload any Persist Variables or gather_buffer data explicitly.

HTH
Regards
TK



Group: DynoMotion Message: 11194 From: Hardy Family Date: 3/10/2015
Subject: Re: C compiler can link with memcpy
Hi Tom,

Yes I am developing a PC application.  Currently, it is using Python with GTK+3, so it is cross-platform.  KMotion-CNC is very nice, but we want to have something which works on Linux as well as Windows, and we want to make it more difficult for end-users of our machine to shoot themselves in the foot.  Putting it another way, we don't want puzzling tech support calls :-)

I didn't want to use the persist vars because they are used for other purposes (like sending MDI to the PC), but now that you mention it, it probably is the best choice since I have control over the PC commands sent back (don't think I'll be using the MDI).  Since these I/Os are only sampled at 20ms or so intervals, I can probably use the existing PC comms protocol to just send those I/O bits when they change.

Regards,
SJH


On Tue, Mar 10, 2015 at 10:21 AM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi SJH,

We don't document those functions but they are likely to be there in the future (not sure exactly why they are linked in).

Regarding MainStatus.  That should not be defined as MainStatus has been changed to be a temporary structure used to be filled in and sent to the PC whenever the host PC requests MainStatus.  It wouldn't make sense to access it from a User Program.

I'm not sure what you are trying to accomplish.  Are you writing your own PC Application? 

There are 8 - 32-bit Persist Variables copied to the MainStatus Structure and included in the uploaded status.  You might consider using 4 of those for your 128 bits of data.  See:

#define PC_COMM_PERSIST 100  // First Persist Variable that is uploaded in status
#define N_PC_COMM_PERSIST 8  // Number of Persist Variables that are uploaded in status

    int    PC_comm[N_PC_COMM_PERSIST];// 8 persist Variables constantly uploaded to send misc commands/data to PC
Or your App could upload any Persist Variables or gather_buffer data explicitly.

HTH
Regards
TK